package com.kingyea.mobilepolice.apimanage.camel.maindemo;

import com.kingyea.camel.runtime.Service;
import com.kingyea.camel.runtime.ServiceContainer;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.GenericApplicationContext;

import java.io.File;


/** 单纯kingyeaCamel的启动方式 */
public class KingyeaCamelLauncher {
	public static void main(String[] args) throws Exception {
//		System.setProperty("KingyeaESBHome", "F:\\Company\\jinyue\\old\\kingyea-esb\\kingyea-esb\\launcher");

//		com.kingyea.esb.platform.Main.start();
		final BeanFactory bf = new GenericApplicationContext();
		final ServiceContainer sc = new ServiceContainer();
		sc.setBeanFactory(bf);

//		try{
			sc.start();
//		}catch (Exception e){
//			e.printStackTrace();
//		}

		File file  = new File("D:\\A\\get_ftp_file.xml");

//		try{
			Service service = sc.loadService(file);
//			service.start();
//		}catch (Exception e){
//			e.printStackTrace();
//		}

//		Object object = new Object();
//		synchronized (object) {
//			object.wait();
//		}
	}

}
